package com.thb.pay.core.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.Method;

public class SimpleUncaughtExceptionHandler implements UncaughtExceptionHandler {

    private final Logger logger = LoggerFactory.getLogger(SimpleUncaughtExceptionHandler.class);

    @Override
    public void handleUncaughtException(Throwable ex, Method method, Object... params) {
        if (logger.isErrorEnabled()) {
            logger.error(String.format("Unexpected error occurred invoking async " +
                    "method '%s'. params '%s'", method, params), ex);
        }
    }

}